#ifndef ieffect_h__
#define ieffect_h__
#include "math/vector.h"
#include "math/matrix44.h"
#include "colour.h"

namespace gecko
{

// forward declare types
class IShader;
struct GeometryBatch;
class RenderContext;

// Interface to Effects (shaders and parameters)
class IEffect
{
public:
	// SetTechnique
	void SetTechnique(const char* techName);

	// Set the shader as begin rendering
	void Begin();

	// Finish the rendering of the shader
	void End();

	// Begin a numbered pass (use GetNumPasses before this)
	void BeginPass(unsigned int pass);

	// End the current rendering pass
	void EndPass();

	// Commit changes to the shader
	void Commit();

	// Set a matrix shader parameter
	void SetMatrix(unsigned int parameter, const Matrix44& m);

	// Set a vector shader parameter
	void SetVector(unsigned int parameter, const Vector3f& v);

	// Set a float shader parameter
	void SetFloat(unsigned int parameter, float f);

	// Set a texture shader parameter
	//void SetTexture(unsigned int parameter, Texture* texture);

	// Set a colour shader parameter
	void SetColour(unsigned int parameter, const Colour& colour);

	// GetRenderBatch
	GeometryBatch* GetRenderBatch();

	// SetRenderBatch
	void SetRenderBatch(GeometryBatch* batch);

	// Release the shader resources
	void Destroy();

	// Get the number of passes defined in the shader
	unsigned int GetNumPasses();

	// Set shader params based on render context
	virtual void SetupFromRenderContext(const RenderContext& renderContext) = 0;

protected:
	IShader* m_Shader;
};

}// namespace gecko

#endif // ieffect_h__